package com.groupbuying.sysconfig.controller;

import com.groupbuying.sysconfig.domain.SysconfigAlipayMessageDO;
import com.groupbuying.sysconfig.service.SysconfigAlipayMessageService;
import com.groupbuying.sysconfig.utils.PageUtils;
import com.groupbuying.sysconfig.utils.Query;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * 支付宝注册配置表
 * 
 * @author gaoruijun
 * @email 18511893135@163.com
 * @date 2019-07-26 11:25:47
 */
 
@RestController
@RequestMapping("/sysconfigAlipayMessage")
public class SysconfigAlipayMessageController {
	@Autowired
	private SysconfigAlipayMessageService sysconfigAlipayMessageService;
	

	
	@GetMapping("/list")
	@RequiresPermissions("sysconfig:sysconfigAlipayMessage:sysconfigAlipayMessage")
	public PageUtils list(@RequestParam Map<String, Object> params){
		//查询列表数据
        Query query = new Query(params);
		List<SysconfigAlipayMessageDO> sysconfigAlipayMessageList = sysconfigAlipayMessageService.list(query);
		int total = sysconfigAlipayMessageService.count(query);
		PageUtils pageUtils = new PageUtils(sysconfigAlipayMessageList, total);
		return pageUtils;
	}
	@GetMapping("/getByAppliName")
	public Map<String, String> getByAppliName(@RequestParam("applicationName") String applicationName){

		return sysconfigAlipayMessageService.getByAppliName(applicationName);
	}
	@GetMapping("/getAll")
	public Map<String,Object> getAll(@RequestParam("id") Integer id){
		Map<String, Object> stringObjectMap = sysconfigAlipayMessageService.get(id);
		return stringObjectMap;
	}
	
}
